import os


def StandardI3DTrain(video_label, save_path):
    lines = []
    file = open(video_label, "r")
    video_paths = file.read().split("\n")
    file.close()
    abnormal = video_paths[:63]
    normal = video_paths[63:]
    for item in abnormal:
        lines.append("%s %d" % (os.path.basename(item), 1))
    for item in normal:
        lines.append("%s %d" % (os.path.basename(item), 0))
    file = open(save_path, "w")
    file.write("\n".join(lines))
    file.close()


if __name__ == "__main__":
    StandardI3DTrain(
        "data/ShangHaiTech/shanghai-i3d-train-10crop.list",
        "data/ShangHaiTech/train.csv"
    )